#ifndef _LOGINSIGNUP_H_
#define _LOGINSIGNUP_H_
#include <map>
#include <string>
using CStrRef = const std::string&;
class InterFace//
{
public:
    virtual void show() = 0;

};

class Login:public InterFace
{
public:
    Login();
    bool login(CStrRef UserName,CStrRef Passwd);
    // void RemoveUser(CStrRef UserName);
    // void ChangePasswd(CStrRef UserName,CStrRef Passwd);
    // void Save();
    void show();
    void printDecorationTop();
    void printPrompt(const char* text);
    void printDecorationBottom();
private:
    std::map<std::string,std::string>UserList;
};


class SignUp:public InterFace
{
public:
    void show();
    void Save(const std::string& UserName,const std::string &passwd,const std::string &filePath);
    bool CheckUserExists(const std::string &UserName, const std::string &filePath);
    void printTopBorder();
    void printPrompt(const char* text);
    void printBottomBorder();
};

class Scren
{
public:
    Scren();
    void show();
    void printTopBorder();
    void printOptions();
    void printBottomBorder();
private:
    std::map<int,InterFace*> faceList;
};

class ChangePasswd:public InterFace
{
public:
    ChangePasswd();
    void show();
    bool Check(CStrRef UserName,CStrRef Passwd);
    void Changepasswd(CStrRef UserName,CStrRef Passwd);
    void Save();
    void printTopBorder();
    void printPrompt(const std::string &text);
    void printBottomBorder();
private:
    std::map<std::string,std::string>UserList;
};

class RemoveUser:public InterFace
{
public:
    RemoveUser();
    void show();
    void Removeuser(CStrRef UserName);
    bool Check(CStrRef UserName,CStrRef Passwd);
    void Save();
    void deleteFile(const std::string& UserName);
private:
    std::map<std::string,std::string>UserList;
};



#endif